package com.ethink.warehouse.api.component;

import com.ethink.warehouse.api.info.MateSkuStockInfo;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Component
public class WarehouseComponent {

    public Map<String, MateSkuStockInfo> queryMateSkuStore(List<String> mateSkuCodeList) {
        Map<String, MateSkuStockInfo> map = new HashMap<>();
        if (CollectionUtils.isEmpty(mateSkuCodeList)) {
            return map;
        }
        List<MateSkuStockInfo> infoList = null;
        if (CollectionUtils.isNotEmpty(infoList)) {
            for (MateSkuStockInfo info : infoList) {
                map.put(info.getMateSku(), info);
            }
        }
        return map;
    }

    public MateSkuStockInfo queryMateSkuStore(String mateSkuCode) {
        List<MateSkuStockInfo> infoList = null;
        return CollectionUtils.isNotEmpty(infoList) ? infoList.get(0) : null;
    }
}
